/**
  ******************************************************************************
  * @file    Templates/Inc/main.h 
  * @author  MCD Application Team
  * @version V1.0.0
  * @date    22-April-2016
  * @brief   Header for main.c module
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
  *
  * Redistribution and use in source and binary forms, with or without modification,
  * are permitted provided that the following conditions are met:
  *   1. Redistributions of source code must retain the above copyright notice,
  *      this list of conditions and the following disclaimer.
  *   2. Redistributions in binary form must reproduce the above copyright notice,
  *      this list of conditions and the following disclaimer in the documentation
  *      and/or other materials provided with the distribution.
  *   3. Neither the name of STMicroelectronics nor the names of its contributors
  *      may be used to endorse or promote products derived from this software
  *      without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  ******************************************************************************
  */
  
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

/* Includes ------------------------------------------------------------------*/
#include "stm32f7xx_hal.h"
#include "SPI_INIT.h"
#include <stdio.h> 
#include <stdlib.h> 
#include "SPI_PANEL_INIT.h"

//#include "usbd_def.h"
//#include "usbd_cdc.h"
//#include "usbd_conf.h"
/* Exported types ------------------------------------------------------------*/
#define debug_log_output  /////log output  
#define BMP_GROWTH      1           //???? ??? ??????  1:??????   0:??????

#define Enable          1
#define Disable         0

#define Enable          1
#define Disable         0

#define NO_Disc			5
#define SD_Disc			0
#define Nand_Disc		1
#define All_Disc		3

#define Video_Mode 				0x10
#define CMD_Mode			    0x00

#define C_PHY 				  0x01
#define D_PHY			      0x00

#define SPI3_Mode				0x20
#define SPI4_Mode				0x30
#define QuadSPI_Mode		0x40
#define QuadSPI_DDR_Mode		0x50

#define SD_Path							"0:"  
#define SD_CFG_Path						"0:/CFG"
#define SD_Conf_File					"0:/PGConfig1.cfg"
#define SD_Conf_File1					"0:/PGConfig2.cfg"
#define SD_Conf_File2					"0:/PGConfig3.cfg"
#define SD_Conf_File3					"0:/PGConfig4.cfg"
#define SD_Conf_File4					"0:/PGConfig5.cfg"
#define SD_Conf_File5					"0:/PGConfig6.cfg"
#define SD_Conf_File_New			    "0:/PGConNew.cfg"

#define Nand_Path						"N0:"
#define Nand_Conf_File					"N0:PGConfig1.cfg"
#define Nand_Conf_File1					"N0:PGConfig2.cfg"
#define Nand_Conf_File2					"N0:PGConfig3.cfg"
#define Nand_Conf_File3					"N0:PGConfig4.cfg"
#define Nand_Conf_File4					"N0:PGConfig5.cfg"
#define Nand_Conf_File5					"N0:PGConfig6.cfg"
#define Nand_Conf_File_New			    "N0:PGConfig_New.cfg"

#define Updata_file                     "0:/code/STM32F4XX_Updata.bin"
#define None_Err						0x00		//????
#define Internal_Flash_W_Error	        0x01		//??Flash?????
#define File_Illegal_Error			    0x02		//??????
#define File_Open_Error					0x03		//??????
#define File_Read_Error					0x04		//??????
#define File_Creat_Error				0x05		//??????

#define Timing_Data_Max 				64
#define Timing_table_num				Fil_Timing_length/4
#define Inter_Flash_Addr				0x080D0000
#define Device_Flash_Addr				0x080E0000
#define Device_Flash_Sect				FLASH_Sector_11
#define Inter_Flash_Sect				FLASH_Sector_10


#define LED_Flick_Fast				    50
#define LED_Flick_Slow				    300



#define RED                             0xFF0000
#define GREEN                           0x00FF00
#define BLUE                            0x0000FF
#define YELLOW                          0xFFFF00
#define PINK                            0xFF00FF
#define CYAN                            0x00FFFF
#define WHITE                           0xFFFFFF
#define BLACK                           0x000000



/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */






void Error_Handler(void);

/* USER CODE BEGIN EFP */

/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/
/* USER CODE BEGIN Private defines */

/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif
#endif /* __MAIN_H */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
